<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <title>Document</title>
    <script src="https://cdn.jsdelivr.net/npm/vue/dist/vue.js"></script>
</head>
<body>
    <div id="app">
        <p>{{ msg|msgFormat('疯狂')|test }}</p>
    </div>

    <script>
        // 定义全局过滤器
        Vue.filter('msgFormat',(data, arg) => {
            return data.replace('单纯', arg);
        });

        Vue.filter('test', function(msg){
            return msg + '============';
        });

        var vm = new Vue({
            el: '#app',
            data:{
                msg:'曾经，我也是一个单纯的少年，单纯的我傻傻的问，谁是世界上最单纯的男人'
            }
        });
    </script>
</body>
</html>